#include<stdio.h>

void main()
{
	int i;
    int ary1[5] = {1, 2, 3, 4, 5};
	int ary2[6] = {1, 2, 3, 4, 5, 6};
	int ary3[7] = {1, 2, 3, 4, 5, 6, 7};
	int ary4[11] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
	for(i = 1 ; ;i++)
	{
		if(ary1[i % 5] == 1 && ary2[i % 6] == 5 && ary3[i % 7] == 4 && ary4[i % 11] == 10)
		{
			printf("%d\n",i);
			break;
		}
	}
}
